//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;
using OpenLS.Core;

namespace OpenLS.Spreadsheet
{
    
    class GenericUndoUnit<T>: IUndoUnit
    {
        private readonly T data;
        private readonly Action<T> action;

        public GenericUndoUnit(T data, Action<T> action)
        {
            this.data = data;
            this.action = action;
        }


        #region IUndoUnit Members

        public void Do()
        {
            action(data);
        }

        public bool Merge(IUndoUnit unit)
        {
            return false;
        }

        #endregion
    }
}
